package com.jieao.template.entity.permissionMgr;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.sql.Timestamp;

/**
 * 权限表(Permission)实体类
 *
 * @author jzw
 * @since 2020-04-30 09:31:05
 */
@Data
@ApiModel(value = "PermissionDO", description = "权限表")
public class PermissionDO implements Serializable
{
    private static final long serialVersionUID = 215947196272815570L;

    @ApiModelProperty(name = "id", value = "表唯一标识")
    @JsonProperty("id")
    private String id;

    @ApiModelProperty(name = "label", value = "权限展示名称")
    @JsonProperty("label")
    private String permissionLabel;

    @ApiModelProperty(name = "show", value = "是否显示 用于页面是否在菜单中显示")
    @JsonProperty("show")
    private Boolean display;

    @ApiModelProperty(name = "code", value = "后台权限控制使用的名称")
    @JsonProperty("code")
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private String permissionCode;

    @ApiModelProperty(name = "url", value = "访问时的url")
    @JsonProperty("url")
    private String permissionUrl;

    @ApiModelProperty(name = "order", value = "排序")
    @JsonProperty("order")
    private String sort;

    @ApiModelProperty(name = "pId", value = "父级id 用于展示作用 最顶级默认为1")
    @JsonProperty("pId")
    private String parentId;

    @ApiModelProperty(name = "ena", value = "是否启用 true 启用 false 禁用")
    @JsonProperty("ena")
    private Boolean enable;

    @ApiModelProperty(name = "type", value = "菜单类型 还是接口类型 还是按钮类型 控制显隐和访问    menu  button  api")
    @JsonProperty("type")
    private String permissionType;

    @JsonIgnore
    private Boolean deleted;

    @ApiModelProperty(name = "crTime", value = "创建时间", hidden = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonProperty(value = "crTime")
    private Timestamp createTime;

    @ApiModelProperty(name = "crId", value = "创建人", hidden = true)
    @JsonProperty(value = "crId")
    private String createId;

    @ApiModelProperty(name = "upTime", value = "修改时间", hidden = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonProperty(value = "upTime")
    private Timestamp updateTime;

    @ApiModelProperty(name = "upId", value = "修改人", hidden = true)
    @JsonProperty(value = "upId")
    private String updateId;
}